﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using SaleLibrary.License;
using SaleLibrary.Score;
using NHibernate;
using BrokerBase.Lib.Core;
using BrokerBase.Lib.Person;
using System.Data;

namespace SaleLibrary.Sale
{
    public interface IClient : IPKItem, INode<IClient>
    {
        DateTime RegTime { get; set; }

        DateTime? Birthday { get; set; }

        SexType Sex { get; set; }

        string Password { get; set; }

        string EMail { get; set; }

        string Contact1 { get; set; }

        string Contact2 { get; set; }

        string Contact3 { get; set; }

        string Contact4 { get; set; }

        string Address { get; set; }

        string CompanyName { get; set; }

        IList<ActiveCode> ActiveCodes { get; set; }

        DateTime LastRegTime { get; set; }

        IScorePolicy Policy { get; set; }

        //IScoreRule DefaultScoreRule { get; set; }

        double TotalAmount { get; set; }

        double TotalScore { get; set; }

        string LicenseCode { get; set; }

        int InviteCodeQty { get; set; }
        /// <summary>
        /// 是否是试用
        /// </summary>
        bool IsTrial { get; }
        /// <summary>
        /// 读取激活码最大的到期时间
        /// </summary>
        /// <param name="sess"></param>
        /// <returns></returns>
        DateTime GetMaxEndTime(ISession sess);

        IList<IScoreRecord> ScoreRecords { get; set; }

        IScoreRecord CreateOrUpdateScoreRecord(IScoreRecordType recType, ActiveCodeReg reg,IScoreRule rule, int level, string description,ISession sess);

        ActiveCode GetInviteCode(ISession sess);

        DateTime CreateDate { get; set; }

        string FullPath { get; set; }

        void UpdateScore(double score, ISession sess);
    }
}
